

from box import ana
from frame import *



class Main:
    def __init__(self, window):
        self.window = window

    def reboot(self, code):
        if len(code) != 1:
            return False
        print("reboot", code)
        try:
            l = ana(code[0])
            print(l)
            self.window.draw3d_list.clear()
            o = Obj()
            o.color = (1, 1, 1)
            o.prog = prog1_mc

            box = make_block(U3(1,1,1))
            for p in l:
                box.t.pos = U3(*p)
                box.as_unit() >> o

            o.u(self.window)
            o >> self.window

        except Exception as e:
            print(e)
            # ~ raise e
            return False

